uboot-mediatek: fix LED on Bananapi BPi-R4 Lite
authorChukun Pan <amadeus@jmu.edu.cn>
Thu, 4 Dec 2025 12:21:08 +0000 (20:21 +0800)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 9 Jan 2026 12:59:54 +0000 (12:59 +0000)
Create a common dtsi for Bananapi BPi-R4 Lite and add missing
gpio-leds. This reduced code and fixed the following LED bug:

LED 'green:status' not found (err=-19)

Fixes: 3a71dd58 ("uboot-mediatek: add support for the BananaPi BPi-R4 Lite")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
package/boot/uboot-mediatek/patches/470-add-bpi-r4-lite.patch

index 4afb01a316318ec654330ebf4e4ba8f2f1104f1c..584a079d41d1dd61bf2c7ad8a60b7e304ae6820b 100644 (file)
 +bootdelay=0
 +bootfile=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-initramfs-recovery.itb
 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-squashfs-sysupgrade.itb
-+bootled_pwr=green:status
-+bootled_rec=blue:status
++bootled_pwr=blue:act
++bootled_rec=blue:act
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
 +bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-nor-preloader.bin
 +bootfile_fip=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-nor-bl31-uboot.fip
 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-squashfs-sysupgrade.itb
-+bootled_pwr=green:status
-+bootled_rec=blue:status
++bootled_pwr=blue:act
++bootled_rec=blue:act
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
 +bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-snand-preloader.bin
 +bootfile_fip=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-snand-bl31-uboot.fip
 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-squashfs-sysupgrade.itb
-+bootled_pwr=green:status
-+bootled_rec=blue:status
++bootled_pwr=blue:act
++bootled_rec=blue:act
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
 +bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-emmc-preloader.bin
 +bootfile_fip=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-emmc-bl31-uboot.fip
 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r4-lite-squashfs-sysupgrade.itb
-+bootled_pwr=green:status
-+bootled_rec=blue:status
++bootled_pwr=blue:act
++bootled_rec=blue:act
 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
 +bootmenu_default=0
 +bootmenu_delay=0
 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       \e[33m$ver\e[0m"
 --- /dev/null
-+++ b/arch/arm/dts/mt7987a-bpi-r4-lite-sd.dts
-@@ -0,0 +1,30 @@
++++ b/arch/arm/dts/mt7987a-bpi-r4-lite.dtsi
+@@ -0,0 +1,36 @@
 +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
 +
-+/dts-v1/;
 +#include "mt7987a.dtsi"
-+#include "mt7987-sd.dtsi"
 +#include <dt-bindings/input/input.h>
 +
 +/ {
 +      model = "BananaPi BPi-R4 Lite";
-+      compatible = "mediatek,mt7987a-sd",
-+                   "mediatek,mt7987a", "mediatek,mt7987";
++      compatible = "mediatek,mt7987a", "mediatek,mt7987";
 +
 +      gpio-keys {
 +              compatible = "gpio-keys";
 +                      debounce-interval = <10>;
 +              };
 +      };
++
++      gpio-leds {
++              compatible = "gpio-leds";
++
++              act {
++                      label = "blue:act";
++                      gpios = <&pio 13 GPIO_ACTIVE_HIGH>;
++              };
++      };
 +};
 --- /dev/null
++++ b/arch/arm/dts/mt7987a-bpi-r4-lite-sd.dts
+@@ -0,0 +1,5 @@
++// SPDX-License-Identifier: (GPL-2.0 OR MIT)
++
++/dts-v1/;
++#include "mt7987a-bpi-r4-lite.dtsi"
++#include "mt7987-sd.dtsi"
+--- /dev/null
 +++ b/arch/arm/dts/mt7987a-bpi-r4-lite-spim-nand.dts
-@@ -0,0 +1,30 @@
+@@ -0,0 +1,5 @@
 +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
 +
 +/dts-v1/;
-+#include "mt7987a.dtsi"
++#include "mt7987a-bpi-r4-lite.dtsi"
 +#include "mt7987-emmc.dtsi"
-+#include <dt-bindings/input/input.h>
-+
-+/ {
-+      model = "BananaPi BPi-R4 Lite";
-+      compatible = "mediatek,mt7987a-emmc",
-+                   "mediatek,mt7987a", "mediatek,mt7987";
-+
-+      gpio-keys {
-+              compatible = "gpio-keys";
-+
-+              reset {
-+                      label = "reset";
-+                      linux,code = <KEY_RESTART>;
-+                      gpios = <&pio 1 GPIO_ACTIVE_LOW>;
-+                      debounce-interval = <10>;
-+              };
-+
-+              wps {
-+                      label = "wps";
-+                      linux,code = <KEY_WPS_BUTTON>;
-+                      gpios = <&pio 0 GPIO_ACTIVE_LOW>;
-+                      debounce-interval = <10>;
-+              };
-+      };
-+};
 --- /dev/null
 +++ b/arch/arm/dts/mt7987a-bpi-r4-lite-emmc.dts
-@@ -0,0 +1,30 @@
+@@ -0,0 +1,5 @@
 +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
 +
 +/dts-v1/;
-+#include "mt7987a.dtsi"
++#include "mt7987a-bpi-r4-lite.dtsi"
 +#include "mt7987-emmc.dtsi"
-+#include <dt-bindings/input/input.h>
-+
-+/ {
-+      model = "BananaPi BPi-R4 Lite";
-+      compatible = "mediatek,mt7987a-emmc",
-+                   "mediatek,mt7987a", "mediatek,mt7987";
-+
-+      gpio-keys {
-+              compatible = "gpio-keys";
-+
-+              reset {
-+                      label = "reset";
-+                      linux,code = <KEY_RESTART>;
-+                      gpios = <&pio 1 GPIO_ACTIVE_LOW>;
-+                      debounce-interval = <10>;
-+              };
-+
-+              wps {
-+                      label = "wps";
-+                      linux,code = <KEY_WPS_BUTTON>;
-+                      gpios = <&pio 0 GPIO_ACTIVE_LOW>;
-+                      debounce-interval = <10>;
-+              };
-+      };
-+};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
 @@ -1136,6 +1136,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \